/* GUI CONVERTED from ececmta.p (converter v1.76) Tue Dec 31 10:45:09 2002 */
/* ececmta.p - PCO/PCR MAINTENANCE                                      */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* $Revision: 1.8.1.6 $                                                     */
/*V8:ConvertMode=Maintenance                                            */
/* REVISION: 7.4      LAST MODIFIED: 07/01/93   BY: pma *H013*          */
/* REVISION: 8.6      LAST MODIFIED: 04/17/97   BY: Joe Gawel    *K0BT* */
/* REVISION: 8.6      LAST MODIFIED: 07/21/97 BY: Maryjeane Date *J1TJ* */
/* REVISION: 8.6      LAST MODIFIED: 10/07/97 BY: John Worden    *K0LP* */
/* REVISION: 8.6      LAST MODIFIED: 05/20/98 BY: *K1Q4* Alfred Tan     */
/* REVISION: 8.5      LAST MODIFIED: 04/26/99 BY: *J3DF* Jean Miller    */
/* REVISION: 9.1      LAST MODIFIED: 08/14/00 BY: *N0KW* Jacolyn Neder  */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* $Revision: 1.8.1.6 $    BY: Katie Hilbert         DATE: 12/27/02  ECO: *P0L8*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

{mfdeclre.i}

define input parameter ecmrecid as recid.
define input parameter copyecn  like mfc_logical.
define input parameter msg_yn   like mfc_logical.
define output parameter yn      as logical.
define buffer ecmmstr for ecm_mstr.

yn = yes.
find ecm_mstr exclusive-lock where recid(ecm_mstr) = ecmrecid no-error.
if not available ecm_mstr then return.

find first ecmmstr no-lock where
   substring(ecmmstr.ecm_nbr,1,8) = substring(ecm_mstr.ecm_nbr,1,8)
   and trim(substring(ecmmstr.ecm_nbr,9,16)) <>
       trim(substring(ecm_mstr.ecm_nbr,9,16))
   no-error.

if available ecmmstr then do:
   if copyecn then
      assign
         ecm_mstr.ecm_doc_type  = ecmmstr.ecm_doc_type
         ecm_mstr.ecm_type      = ecmmstr.ecm_type
         ecm_mstr.ecm_assign    = ecmmstr.ecm_assign
         ecm_mstr.ecm_init      = ecmmstr.ecm_init
         ecm_mstr.ecm_open_date = ecmmstr.ecm_open_date
         ecm_mstr.ecm_title     = ecmmstr.ecm_title
         ecm_mstr.ecm_cmmt[1]   = ecmmstr.ecm_cmmt[1]
         ecm_mstr.ecm_cmmt[2]   = ecmmstr.ecm_cmmt[2]
         ecm_mstr.ecm_cmmt[3]   = ecmmstr.ecm_cmmt[3]
         ecm_mstr.ecm_cmmt[4]   = ecmmstr.ecm_cmmt[4]
         ecm_mstr.ecm_cmmt[5]   = ecmmstr.ecm_cmmt[5]
         ecm_mstr.ecm_status    = ecmmstr.ecm_status
         ecm_mstr.ecm_user1     = ecmmstr.ecm_user1
         ecm_mstr.ecm_user2     = ecmmstr.ecm_user2
         ecm_mstr.ecm_name      = ecmmstr.ecm_name
         ecm_mstr.ecm_nbr_fr    = ecmmstr.ecm_nbr_fr.
   yn = no.
   if msg_yn then do:
      {pxmsg.i &MSGNUM=2154 &ERRORLEVEL=2} /*Subsidiary PCRs*/
   end.
end.
